#!/usr/bin/env python3

import fileinput
import sys

args = sys.argv[1:]
if len(args) <= 0:
    pass

n = 1024 * 1024

if len(args) > 0:
    n = int(args[0])

if n >= 0:
    sys.stdout.buffer.write(sys.stdin.buffer.read(n))
else:
    data = sys.stdin.buffer.read()
    sys.stdout.buffer.write(data[0:n])

